package com.ltu.timkor6.gamesite.shared;

import java.util.Date;
import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class DBGames
{
	
	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Long id;
	@Persistent
	private String userName;
	@Persistent
	private String gameTitle;
	@Persistent
	private int turns;
	@Persistent
	private int points;
	@Persistent
	private int time;
	@Persistent
	private int createdDate;
	
	public DBGames()
	{
		Date javaDate = new Date();
		int timeStamp = (int) (javaDate.getTime() * .001);
		this.createdDate = timeStamp;
	}
	
	public DBGames(String userName, String gameTitle)
	{
		this();
		this.userName = userName;
		this.gameTitle = gameTitle;
	}
	
	public Long getId()
	{
		return this.id;
	}
	
	public int getDate()
	{
		return this.createdDate;
	}
	
	public String getGameTitle()
	{
		return this.gameTitle;
	}
	
	public int getPoints()
	{
		return this.points;
	}
	
	public int getTime()
	{
		return this.time;
	}
	
	public int getTurns()
	{
		return this.turns;
	}
	
	public String getUserName()
	{
		return this.userName;
	}
	
	public void setGameTitle(String gameTitle)
	{
		this.gameTitle = gameTitle;
	}
	
	public void setPoints(int points)
	{
		this.points = points;
	}
	
	public void setTime(int time)
	{
		this.time = time;
	}
	
	public void setTurns(int turns)
	{
		this.turns = turns;
	}
	
	public void setUserName(String userName)
	{
		this.userName = userName;
	}
}
